
package hopital.comptable;

import hopital.orm.Comptable;
import hopital.orm.Docteur;
import hopital.ui.Login;
import hopital.ui.Password;
import javax.swing.JFrame;

public class Interface extends JFrame {

    public static Comptable getCom() {
        return _com;
    }

    
    
    private static Comptable _com ;
    public Interface(Comptable _com ) {
        Interface._com=_com;
        initComponents();
        setExtendedState(MAXIMIZED_BOTH);
        setLocationRelativeTo(null);
        _info.setText(_com.toString());
        setVisible(true);
        
    }

    @SuppressWarnings("unchecked")
    private void initComponents() {//GEN-BEGIN:initComponents

        jToolBar1 = new javax.swing.JToolBar();
        jProgressBar1 = new javax.swing.JProgressBar();
        _info = new javax.swing.JLabel();
        jToolBar3 = new javax.swing.JToolBar();
        jSeparator1 = new javax.swing.JToolBar.Separator();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        patientInterface2 = new hopital.comptable.PatientInterface();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Comptable");
        setIconImage(new javax.swing.ImageIcon(getClass().getResource("/hopital/icon/group41.png")).getImage());

        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);
        jToolBar1.add(jProgressBar1);

        _info.setIcon(new javax.swing.ImageIcon(getClass().getResource("/hopital/icon/user77.png"))); // NOI18N
        jToolBar1.add(_info);

        getContentPane().add(jToolBar1, java.awt.BorderLayout.SOUTH);

        jToolBar3.setRollover(true);
        jToolBar3.add(jSeparator1);

        getContentPane().add(jToolBar3, java.awt.BorderLayout.NORTH);

        jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.BOTTOM);

        patientInterface2.setVisible(true);
        jTabbedPane1.addTab("Patients", patientInterface2);

        getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER);
        jTabbedPane1.getAccessibleContext().setAccessibleName("Patient");
        jTabbedPane1.getAccessibleContext().setAccessibleDescription("");

        jMenu1.setText("Session");

        jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/hopital/icon/open95.png"))); // NOI18N
        jMenuItem2.setText("Changer Mot De Pass");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/hopital/icon/power27.png"))); // NOI18N
        jMenuItem1.setText("Deconnecter");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        pack();
    }//GEN-END:initComponents

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        Login aInterface = new  Login();
        dispose();
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        try {
            Password password = new Password(this, _com); 
        } catch (Exception e) {
        }
        
    }//GEN-LAST:event_jMenuItem2ActionPerformed


    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel _info;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JToolBar.Separator jSeparator1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JToolBar jToolBar3;
    private hopital.comptable.PatientInterface patientInterface2;
    // End of variables declaration//GEN-END:variables
}
